package com.ruoyi.common.enums.comlbs;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * pop中短报文类型枚举
 */
public enum ShortMsgTypeEnum implements DataEnum {


    Normal(0, "正常消息"),

    Sensor(1, "传感器消息"),

    Mayday(2, "求救消息")
    ;

    private Integer code;

    private String text;

    ShortMsgTypeEnum(Integer code) {
        this.code = code;
    }

    ShortMsgTypeEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    @JsonCreator
    public static ShortMsgTypeEnum fromInt(Integer code) {
        return DataEnum.getEnum(ShortMsgTypeEnum.class, code);
    }

    @JsonCreator
    public static ShortMsgTypeEnum fromString(String code) {
        return DataEnum.getEnum(ShortMsgTypeEnum.class, code);
    }


    @Override
    @JsonValue
    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

}
